package com.woniuxy.produce;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class WorkProduce {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String msg){
        //往队列发送消息的方法
        rabbitTemplate.convertAndSend("workQueue",msg);
    }
}
